package com.example.hhhh;

import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;

import com.alibaba.android.arouter.facade.annotation.Route;

/**
 * @ProjectName: Hhhh
 * @Package: com.example.hhhh
 * @ClassName: EighthAct
 * @Description: java类作用描述
 * @Author: songhua
 * @CreateDate: 2020/4/8 0008 14:11
 */
@Route(path = "/app/EighthAct")
public class EighthAct extends SwipeBackActivity {
    private TextView textView;
    private RatingBar start;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_eighth);
         start = (RatingBar) findViewById(R.id.ratingBar);
        textView = (TextView) findViewById(R.id.tv);
        //获取已点的星数，因为步长可以为小数，所以获取到的是float
        start.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
                //得到当前评分条的当前值
                textView.setText(ratingBar.getRating() + "");
            }
        });


    }
}
